import sys, os, glob
defs     = ['_GLIBCXX_HAS_GTHREADS', '_REENTRANT', 'DEBUG', 'DEBUGMEM']
includes = ['.', '../shared', '../common', '../fsops', '../hadoopops', '../hadoopops/gen-cpp', '../httplib', '../serverlib', '../../includes', '../../includes/thrift']
libpath = ['../../target/libs', '../../libs']
libs = ['httplib', 'serverlib', 'hadoopops', 'common', 'shared', 'fcgi', 'thrift', 'jsoncpp', 'pthread', 'tbb']
cflags = '-fpermissive -std=c++0x -ggdb -pthread -Wall -Werror'
bin = 'dataserver'
    
files = glob.glob("*.cc") 
env = Environment(CCFLAGS=cflags, CPPDEFINES=defs, CPPPATH=includes, LIBPATH=libpath, LIBS=libs)
dataserver = env.Program(bin, files)

install_dir = '../../target/bin'
env.Install(install_dir, dataserver)
env.Install(install_dir, '../etc/dp.conf')
env.Install(install_dir, '../etc/start.sh')
env.Alias('install', install_dir)
